<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 1. 简单类型
      let num = 1;
      console.log("num", num);
      let food = "西兰花炒蛋";
      console.log("food", food);
      let male = false;
      console.log("male", male);
      let empty = undefined;
      console.log("empty", empty);
      let empty1 = null;
      console.log("empty1", empty1);

      // 2.复杂类型
      let person = {
        name: "jack",
        age: 18,
        male: false,
      };
      console.log("person", person);
      let foods = ["西兰花", "西葫芦", "西瓜", "西北风"];
      console.log(foods);
      function star() {
        console.log("你好");
      }
      star();

      // 3. 常量
      const dog = {
        name: "柯基",
        color: "黄色",
        food: ["骨头", "狗粮"],
      };

      // 对象类型， 是引用类型
      // 对象.xxx = 新的值 dog 对应的地址没变
      // 修改的是 地址对应的数据中的 color 的值
      dog.color = "绿色";
      console.log(dog);
    </script>
  </body>
</html>
